package com.samsung.list;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.samsung.R;

public class ViewMessageActivity extends Activity
{
	
	private Button sendMessage;
	private TextView messageBody;
	private String number;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.mymessage);
		
		sendMessage = (Button) findViewById(R.id.sendMessage);
		messageBody = (TextView) findViewById(R.id.messageBody);
		
		Intent intent = getIntent();
		
		number = intent.getStringExtra("number");
		messageBody.setText(intent.getStringExtra("body"));
		
		sendMessage.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v)
			{
				// TODO Auto-generated method stub
				Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:"+number));
				startActivity(intent);
			}
			
		});
		
	}

}
